package com.cj.mvvmlib.util

import android.widget.Toast
import com.cj.mvvmlib.base.BaseApp

object ToastUtil {
    private var toast: Toast? = null
    fun showShortToast(msg: String?) {
        toast?.cancel()
        toast = Toast.makeText(BaseApp.getContext(), msg, Toast.LENGTH_SHORT)
        toast?.show()
    }

    fun showLongToast(msg: String?) {
        Toast.makeText(BaseApp.getContext(), msg, Toast.LENGTH_LONG).show()
    }
}